package com.wowudi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wowudi.entity.HoPay;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface HoPayMapper extends BaseMapper<HoPay> {
    @Select("select * from ho_pay hp,patients pt where hp.pt_id=pt.pt_id and hp.hp_isdel=0 and (pt.pt_card =#{patiname} or pt.pt_name like CONCAT(CONCAT('%',#{patiname}),'%'))")
    @ResultMap("BaseResultMap")
    Page<HoPay> getAllBynameandid(@Param("page")Page<HoPay> page, @Param("cartid")String cartid, @Param("patiname")String patiname);
}